package com.learning.config;

import com.netflix.client.config.IClientConfig;
import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * description:
 *
 * @author minghuiZhang
 * @date created in  14:38 2018/5/2
 * modified by
 */
@Configuration
public class RibbonConfiguration {
	@Autowired
	private IClientConfig config;

	@Bean
	public IRule ribbonRule(IClientConfig config) {
		//方法名不能改变，否则会出错
		return new RandomRule();
	}
}
